﻿using System.Security.Cryptography;
using System.Text;

namespace ylyfDataCommon.Cypher
{
    public class SHA512Provider: CypherProvider
    {
        public override string Encryption(string str, string KEY = null, string IV = null)
        {
            SHA512CryptoServiceProvider provider = new SHA512CryptoServiceProvider();
            byte[] data = provider.ComputeHash(Encoding.UTF8.GetBytes(str));
            StringBuilder sBuilder = new StringBuilder();
            foreach (byte t in data)
            {
                sBuilder.Append(t.ToString("x2"));
            }
            return sBuilder.ToString();
        }
    }
}